package com.example.a2207_zh.detail

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.example.a2207_zh.entity.GiftEntityResult
import com.example.a2207_zh.mvvm.BaseViewModel
import kotlinx.coroutines.launch

class VideoDetailViewModel:BaseViewModel() {

    val giftSuccess = MutableLiveData<GiftEntityResult>()
    val giftFail = MutableLiveData<String>()
    fun gift(){
        viewModelScope.launch {
            try {
                giftSuccess.value = apiServer.gift()
            }catch (e:Exception){
                giftFail.value = e.message
            }
        }
    }

}